﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MaterialTypeList.aspx.cs" Inherits="Material_MaterialTypeList" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>正贸智能仓储物流管理系统</title>
    <link href="../css/css.css" rel="stylesheet" type="text/css" />
    <script src="../JS/jquery.js"></script>
    <script src="../js/Validate.js"></script>

    <script type="text/javascript" language="javascript">
   
        function SelectAllCheckBox() {
            var form = document.forms[0];
            for (i = 0; i < form.elements.length; i++) {
                if (form.elements[i].checked == false) {
                    j = 0;
                }
                else {
                    j = 1;
                }
            } if (j == 0) {
                for (i = 0; i < form.elements.length; i++) {
                    form.elements[i].checked = true;
                }
            }
            else {
                for (i = 0; i < form.elements.length; i++) {
                    form.elements[i].checked = false;
                }
            }
        }

        //进入物料类别新增子页面
        function OpenMaterialTypeAdd() {

            document.getElementById('<%=hidden.ClientID %>').value = window.showModalDialog("MaterialTypeAddOrEdit.aspx?Mode=Add", window, "dialogWidth=600px;dialogHeight=234px;scroll:no;resizable:no;status:0;");
            document.URL = location.href;
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td style="height: 30px">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="background-image: url(../images/tab_03.gif); background-repeat: repeat-x;
                                width: 12px;">
                                &nbsp;
                            </td>
                            <td style="background-image: url(../images/tab_05.gif); background-repeat: repeat-x;
                                height: 30px;">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 46%; vertical-align: middle;">
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td style="width: 5%; vertical-align: middle;">
                                                        <img src="../images/tb.gif" width="16" height="16" />
                                                    </td>
                                                    <td style="width: 95%;">
                                                        <span>你当前的位置</span>：基础数据-物料类别列表
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                        <td width="54%">
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td width="16" style="background-image: url(../images/tab_07.gif); height: 30px;">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="background-image: url(../images/tab_12.gif); width: 8px;">
                                &nbsp;
                            </td>
                            <td>
                                <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #b5d6e6;">
                                    <tr>
                                        <td style="padding: 2px;">
                                            <table width="100%" cellspacing="0" cellpadding="0" border="1" bordercolordark="#ffffff"
                                                bordercolorlight="#b5d6e6">
                                                <tr>
                                                    <td style="width: 60%" align="right">
                                                        &nbsp;
                                                    </td>
                                                    <td style="width: 20%; padding-left: 2px;">
                                                        <asp:ImageButton ID="ibtnAdd" runat="server" ImageUrl="~/Images/btn/btn_add.gif"
                                                            OnClientClick="OpenMaterialTypeAdd()" OnClick="ibtnAdd_Click"  />&nbsp;
                                                        <asp:ImageButton ID="ibtnAllDel" runat="server" ImageUrl="~/Images/btn/Delete.gif"
                                                                OnClick="ibtnAllDel_Click" Visible="False" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="padding: 2px">
                                            <div style="margin-left: 0px; margin-top: 3px; width: 100%; height:750px; overflow: auto;
                                                overflow-x: auto; overflow-y: auto;">
                                                <asp:GridView ID="gvMType" runat="server" AutoGenerateColumns="False" Width="100%"
                                                    BorderWidth="1px" BorderColor="#B5D6E6" CellPadding="0" DataKeyNames="TypeID" OnRowDataBound="gvMType_RowDataBound"
                                                    AllowPaging="true" PageSize="20" OnPageIndexChanging="gvMType_PageIndexChanging">
                                                    <Columns>
                                                        <asp:TemplateField Visible="false">
                                                            <HeaderTemplate>
                                                                <input id="hchkSelect" type="checkbox"   onclick="SelectAllCheckBox()" />
                                                            </HeaderTemplate>
                                                            <ItemTemplate>
                                                                <asp:CheckBox ID="chkSelect" runat="server" />
                                                            </ItemTemplate>
                                                            <ItemStyle Width="5%" />
                                                        </asp:TemplateField>

                                                        <asp:TemplateField HeaderText="序号">
                                                            <ItemTemplate>
                                                                <asp:Label ID="LabNumber" runat="server" Text="<%#Container.DataItemIndex+1%>"></asp:Label>
                                                            </ItemTemplate>
                                                            <ItemStyle Width="5%" />
                                                        </asp:TemplateField>

                                                        <asp:BoundField DataField="TypeID" HeaderText="类别ID号">
                                                            <ItemStyle Width="20%" />
                                                        </asp:BoundField>
                                                        <asp:BoundField DataField="TypeName" HeaderText="类别名称">
                                                            <ItemStyle Width="30%" />
                                                        </asp:BoundField>
                                                       
                                                       <%-- <asp:BoundField DataField="ParentTypeID" HeaderText="所属父类ID号">
                                                            <ItemStyle Width="20%" />
                                                        </asp:BoundField>--%>

                                                        <asp:TemplateField HeaderText="所属父类ID号" >
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_ParentTypeID" runat="server" name="parenttypeid" Text='<%# Bind("ParentTypeID") %>'></asp:Label>
                                                             </ItemTemplate>
                                                             <ItemStyle Width="20%" />
                                                         </asp:TemplateField>
                                                        
                                                        <asp:TemplateField HeaderText="基本操作">
                                                            <ItemTemplate>
                                                                <asp:ImageButton ID="ibtnEdit" runat="server" CommandArgument='<%# Bind("TypeID") %>' 
                                                                    ImageUrl="../Images/edt.gif" Style="height: 16px" />
                                                                <asp:ImageButton ID="ibtnDel" runat="server" CommandArgument='<%# Bind("TypeID") %>'
                                                                    ImageUrl="../Images/del.gif" OnClientClick="return confirm('确定删除吗？')" Style="height: 16px"
                                                                    OnClick="ibtnDel_Click" />
                                                            </ItemTemplate>
                                                            <ItemStyle Width="10%" />
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <%--<PagerStyle HorizontalAlign="Right" />--%>
                                                    <HeaderStyle HorizontalAlign="Center" CssClass="gvHeader" />
                                                    <RowStyle CssClass="gvRow" HorizontalAlign="Center" />
                                                    <PagerSettings Mode="Numeric"></PagerSettings>
                                                </asp:GridView>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td style="background-image: url(../images/tab_15.gif); width: 8px;">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td style="background-image: url(../images/tab_19.gif); height: 35px;">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td style="width: 12px; height: 35px;">
                                <img src="../images/tab_18.gif" width="12" height="35" />
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td width="16">
                                <img src="../images/tab_20.gif" width="16" height="35" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
         <asp:HiddenField ID="hidden" runat="server" />
    </div>
    </form>
</body>
</html>
